﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TryHelp
{
    public class Alert
    {
        public static void Info(string text, string caption = "提示")
        {
            DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        public static void Error(string text, string caption = "错误")
        {
            DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        public static void Warning(string text, string caption = "警告")
        {
            DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }
        public static bool Confirm(string text, string caption = "操作确认")
        {
            var res= DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            return res == DialogResult.OK ? true : false;
        }

        
    }
}
